package zhizhemodi.tech.short_term_bwork.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

import zhizhemodi.tech.short_term_bwork.entity.PlanToDevice;
import zhizhemodi.tech.short_term_bwork.mapper.PlanToDeviceMapper;

@Service
public class PlanToDeviceService {
    
    @Autowired
    PlanToDeviceMapper planToDeviceMapper;

    public List<Integer> getDeviceListByPlanId(Integer planId) {
        return planToDeviceMapper.selectDeviceIds(planId);
    }

    public List<PlanToDevice> getPlanToDeviceList(Integer planId) {
        QueryWrapper<PlanToDevice> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("plan_id", planId);
        return planToDeviceMapper.selectList(queryWrapper);
    }
}
